package quartz.demo1;

import org.quartz.Scheduler;

public class test {

	public static void main(String[] args) throws Exception {
		//创建定时任务
		System.out.println("创建定时任务。。。");
		QuartzManager.addJob("job", "jobgroup", "tiggergroup", RequestJobUrl.class, "40 50 15 ? * *", "请求路径");
//		System.out.println("开始sleep55s。。。");
//		Thread.sleep(55000);
//		//获取调度器
//		Scheduler sched = QuartzManager.getScheduler();
//		//修改调度器执行时间
//		System.out.println("60s后修改启动参数再次执行。。。");
//		QuartzManager.modifyJobTime("job", "jobgroup", "tiggergroup", "0/3 49 15 ? * *", "请求路径2");
//		//暂停任务10s
//		System.out.println("开始sleep10s，30s后暂停。。。");
//		Thread.sleep(30000);
//		QuartzManager.pauseJob("job", "jobgroup");
//		System.out.println("30s过完，再次开启。。。");
//		//再次开启任务
//		QuartzManager.startJob("job", "jobgroup");
//		System.out.println("开始sleep30s,30s后移除定时任务job。。。");
//		Thread.sleep(30000);
//		//移除定时任务
//		QuartzManager.removeJob("job", "jobgroup", "tiggergroup");
//		System.out.println("开始sleep30s,30s后关闭定时任务");
//		Thread.sleep(30000);
//		//关闭定时任务
//		QuartzManager.shutdownJobs();
	}
}
